package com.iran.calculator.simpleFactory;

import java.util.Scanner;

/**
 * 简单工厂模式
 */
public class Test {

    public static void main(String[] args) {
        System.out.println("请输入价格");
        Scanner scan = new Scanner(System.in);
        double money = Double.parseDouble(scan.nextLine());
        System.out.println("请输入计算方式，如打八折");
        scan = new Scanner(System.in);
        SuperCash superCash = FactoryCash.createCashAccept(scan.nextLine());
        System.out.println(superCash.acceptCash(money));
    }
}
